<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>GitHub Copilot - AI 代码助手专家指南</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #2b5876 0%, #4e4376 100%);
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .feature-icon {
            font-size: 2.5rem;
            color: #4f46e5;
        }
        .code-block {
            background-color: #282c34;
            border-left: 4px solid #4f46e5;
        }
        .version-card:hover {
            transform: scale(1.03);
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
        }
        .tooltip:hover .tooltip-text {
            visibility: visible;
            opacity: 1;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-4 leading-tight">GitHub Copilot<br>您的 AI 结对编程伙伴</h1>
                    <p class="text-xl opacity-90 mb-8">基于 OpenAI Codex 的智能代码助手，帮助开发者提高编程效率，让代码编写如虎添翼</p>
                    <div class="flex space-x-4">
                        <a href="#features" class="bg-white text-indigo-600 hover:bg-gray-100 px-6 py-3 rounded-lg font-medium transition duration-300">
                            <i class="fas fa-star mr-2"></i>探索功能
                        </a>
                        <a href="#versions" class="border border-white text-white hover:bg-white hover:text-indigo-600 px-6 py-3 rounded-lg font-medium transition duration-300">
                            <i class="fas fa-crown mr-2"></i>版本对比
                        </a>
                    </div>
                </div>
                <div class="md:w-1/2">
                    <img src="https://cdn.nlark.com/yuque/0/2025/png/21449790/1743597086182-6c8ef199-f29c-4877-8c24-98ca7242da05.png" alt="GitHub Copilot 界面" class="rounded-lg shadow-2xl transform rotate-1 hover:rotate-0 transition duration-500">
                </div>
            </div>
        </div>
    </section>

    <!-- Features Section -->
    <section id="features" class="py-16 px-4">
        <div class="container mx-auto max-w-6xl">
            <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">核心功能亮点</h2>
            
            <div class="grid md:grid-cols-2 lg:grid-cols-4 gap-8 mb-16">
                <div class="bg-white p-6 rounded-xl shadow-md card-hover transition duration-300">
                    <div class="feature-icon mb-4">
                        <i class="fas fa-code"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">代码自动补全</h3>
                    <p class="text-gray-600">实时建议代码片段，减少重复性工作，支持多种编程语言</p>
                </div>
                
                <div class="bg-white p-6 rounded-xl shadow-md card-hover transition duration-300">
                    <div class="feature-icon mb-4">
                        <i class="fas fa-magic"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">代码生成</h3>
                    <p class="text-gray-600">根据函数名或注释生成完整实现，提升开发效率</p>
                </div>
                
                <div class="bg-white p-6 rounded-xl shadow-md card-hover transition duration-300">
                    <div class="feature-icon mb-4">
                        <i class="fas fa-chart-line"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">代码优化</h3>
                    <p class="text-gray-600">识别冗余代码，提供优化建议，提升代码质量</p>
                </div>
                
                <div class="bg-white p-6 rounded-xl shadow-md card-hover transition duration-300">
                    <div class="feature-icon mb-4">
                        <i class="fas fa-plug"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-3 text-gray-800">多环境支持</h3>
                    <p class="text-gray-600">兼容 VS Code、IntelliJ IDEA 等主流开发环境</p>
                </div>
            </div>

            <div class="bg-white rounded-xl shadow-lg overflow-hidden mb-12">
                <div class="p-6 md:p-8">
                    <h3 class="text-2xl font-bold mb-6 text-gray-800">代码自动补全示例</h3>
                    <div class="flex flex-col md:flex-row gap-8">
                        <div class="md:w-1/2">
                            <div class="code-block text-gray-200 p-4 rounded-lg mb-4">
                                <pre><code>public int sum(int a, int b) {</code></pre>
                            </div>
                            <p class="text-gray-600 mb-4">输入方法签名后，Copilot 会自动补全方法体：</p>
                            <div class="code-block text-gray-200 p-4 rounded-lg">
                                <pre><code>public int sum(int a, int b) {
    return a + b;
}</code></pre>
                            </div>
                        </div>
                        <div class="md:w-1/2">
                            <div class="bg-indigo-50 p-6 rounded-lg">
                                <h4 class="font-bold text-indigo-700 mb-3 flex items-center">
                                    <i class="fas fa-lightbulb mr-2"></i>使用技巧
                                </h4>
                                <ul class="space-y-2 text-gray-700">
                                    <li class="flex items-start">
                                        <i class="fas fa-keyboard text-indigo-500 mr-2 mt-1"></i>
                                        <span><span class="font-medium">Tab</span> 接受 Copilot 建议</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-keyboard text-indigo-500 mr-2 mt-1"></i>
                                        <span><span class="font-medium">Esc</span> 忽略 Copilot 建议</span>
                                    </li>
                                    <li class="flex items-start">
                                        <i class="fas fa-keyboard text-indigo-500 mr-2 mt-1"></i>
                                        <span><span class="font-medium">Ctrl + Enter</span> 查看更多建议</span>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="grid md:grid-cols-2 gap-8 mb-16">
                <div class="bg-white rounded-xl shadow-lg overflow-hidden">
                    <div class="p-6 md:p-8">
                        <h3 class="text-2xl font-bold mb-6 text-gray-800">根据注释生成代码</h3>
                        <div class="code-block text-gray-200 p-4 rounded-lg mb-4">
                            <pre><code>// 获取用户列表</code></pre>
                        </div>
                        <p class="text-gray-600 mb-4">Copilot 会自动生成完整方法：</p>
                        <div class="code-block text-gray-200 p-4 rounded-lg">
                            <pre><code>public List&lt;User&gt; getUserList() {
    String sql = "SELECT * FROM users";
    return jdbcTemplate.query(sql, 
        new BeanPropertyRowMapper&lt;&gt;(User.class));
}</code></pre>
                        </div>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow-lg overflow-hidden">
                    <div class="p-6 md:p-8">
                        <h3 class="text-2xl font-bold mb-6 text-gray-800">生成单元测试</h3>
                        <div class="code-block text-gray-200 p-4 rounded-lg mb-4">
                            <pre><code>// 测试 sum 方法</code></pre>
                        </div>
                        <p class="text-gray-600 mb-4">Copilot 生成完整测试用例：</p>
                        <div class="code-block text-gray-200 p-4 rounded-lg">
                            <pre><code>@Test
public void testSum() {
    assertEquals(5, sum(2, 3));
    assertEquals(0, sum(-1, 1));
    assertEquals(10, sum(5, 5));
}</code></pre>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Version Comparison -->
    <section id="versions" class="py-16 px-4 bg-gray-100">
        <div class="container mx-auto max-w-6xl">
            <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">版本选择指南</h2>
            
            <div class="grid md:grid-cols-2 lg:grid-cols-4 gap-6 mb-12">
                <div class="bg-white rounded-xl shadow-md p-6 version-card transition duration-300">
                    <h3 class="text-xl font-bold mb-4 text-gray-800">Free</h3>
                    <p class="text-3xl font-bold mb-4 text-indigo-600">$0<span class="text-lg text-gray-500">/月</span></p>
                    <ul class="space-y-3 mb-6 text-gray-600">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>每月 2000 次代码补全</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>50 次 Chat 请求</span>
                        </li>
                    </ul>
                    <button class="w-full bg-gray-200 hover:bg-gray-300 text-gray-800 py-2 rounded-lg font-medium transition duration-300">
                        免费试用
                    </button>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 version-card transition duration-300 border-2 border-indigo-200 relative">
                    <div class="absolute -top-3 -right-3 bg-indigo-600 text-white text-xs font-bold px-3 py-1 rounded-full">
                        推荐
                    </div>
                    <h3 class="text-xl font-bold mb-4 text-gray-800">Pro</h3>
                    <p class="text-3xl font-bold mb-4 text-indigo-600">$10<span class="text-lg text-gray-500">/月</span></p>
                    <ul class="space-y-3 mb-6 text-gray-600">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>无限次代码补全</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>无限次 Chat 请求</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>前 30 天免费</span>
                        </li>
                    </ul>
                    <button class="w-full bg-indigo-600 hover:bg-indigo-700 text-white py-2 rounded-lg font-medium transition duration-300">
                        立即订阅
                    </button>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 version-card transition duration-300">
                    <h3 class="text-xl font-bold mb-4 text-gray-800">Business</h3>
                    <p class="text-3xl font-bold mb-4 text-indigo-600">$19<span class="text-lg text-gray-500">/用户/月</span></p>
                    <ul class="space-y-3 mb-6 text-gray-600">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>Pro 版所有功能</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>团队管理功能</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>企业级支持</span>
                        </li>
                    </ul>
                    <button class="w-full bg-indigo-100 hover:bg-indigo-200 text-indigo-700 py-2 rounded-lg font-medium transition duration-300">
                        团队购买
                    </button>
                </div>
                
                <div class="bg-white rounded-xl shadow-md p-6 version-card transition duration-300">
                    <h3 class="text-xl font-bold mb-4 text-gray-800">Enterprise</h3>
                    <p class="text-3xl font-bold mb-4 text-indigo-600">$39<span class="text-lg text-gray-500">/用户/月</span></p>
                    <ul class="space-y-3 mb-6 text-gray-600">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>Business 版所有功能</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>企业级安全和合规性</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mr-2 mt-1"></i>
                            <span>定制化服务</span>
                        </li>
                    </ul>
                    <button class="w-full bg-indigo-100 hover:bg-indigo-200 text-indigo-700 py-2 rounded-lg font-medium transition duration-300">
                        联系销售
                    </button>
                </div>
            </div>

            <div class="bg-white rounded-xl shadow-lg overflow-hidden">
                <div class="p-6 md:p-8">
                    <h3 class="text-2xl font-bold mb-6 text-gray-800">与其他 AI 代码助手对比</h3>
                    
                    <div class="overflow-x-auto">
                        <table class="min-w-full divide-y divide-gray-200">
                            <thead class="bg-gray-50">
                                <tr>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">工具</th>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">主要特点</th>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">适用人群</th>
                                </tr>
                            </thead>
                            <tbody class="bg-white divide-y divide-gray-200">
                                <tr class="hover:bg-gray-50">
                                    <td class="px-6 py-4 whitespace-nowrap font-medium text-gray-900">GitHub Copilot</td>
                                    <td class="px-6 py-4">强大的代码自动补全，适配主流 IDE</td>
                                    <td class="px-6 py-4">所有开发者</td>
                                </tr>
                                <tr class="hover:bg-gray-50">
                                    <td class="px-6 py-4 whitespace-nowrap font-medium text-gray-900">Tabnine</td>
                                    <td class="px-6 py-4">支持离线运行，更注重隐私</td>
                                    <td class="px-6 py-4">企业、隐私敏感开发者</td>
                                </tr>
                                <tr class="hover:bg-gray-50">
                                    <td class="px-6 py-4 whitespace-nowrap font-medium text-gray-900">Codeium</td>
                                    <td class="px-6 py-4">免费版 Copilot 替代品</td>
                                    <td class="px-6 py-4">个人开发者</td>
                                </tr>
                                <tr class="hover:bg-gray-50">
                                    <td class="px-6 py-4 whitespace-nowrap font-medium text-gray-900">ChatGPT / DeepSeek Code</td>
                                    <td class="px-6 py-4">AI 代码生成，但不支持 IDE 直接补全</td>
                                    <td class="px-6 py-4">需要 AI 代码解释的用户</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Installation Guide -->
    <section class="py-16 px-4">
        <div class="container mx-auto max-w-6xl">
            <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">安装与使用指南</h2>
            
            <div class="grid md:grid-cols-2 gap-8 mb-16">
                <div>
                    <h3 class="text-2xl font-bold mb-6 text-gray-800">安装步骤</h3>
                    <div class="space-y-6">
                        <div class="flex items-start">
                            <div class="flex-shrink-0 bg-indigo-100 rounded-full p-2 mr-4">
                                <span class="text-indigo-600 font-bold">1</span>
                            </div>
                            <div>
                                <h4 class="font-bold text-gray-800 mb-2">订阅 GitHub Copilot</h4>
                                <p class="text-gray-600">GitHub Copilot 是一个付费订阅服务，需要 GitHub 账户进行订阅。订阅后，你可以免费试用 30 天。</p>
                            </div>
                        </div>
                        
                        <div class="flex items-start">
                            <div class="flex-shrink-0 bg-indigo-100 rounded-full p-2 mr-4">
                                <span class="text-indigo-600 font-bold">2</span>
                            </div>
                            <div>
                                <h4 class="font-bold text-gray-800 mb-2">在 IntelliJ IDEA 安装插件</h4>
                                <ul class="list-disc pl-5 text-gray-600 space-y-1">
                                    <li>打开 IntelliJ IDEA</li>
                                    <li>进入 File → Settings → Plugins</li>
                                    <li>搜索 GitHub Copilot 并点击 Install</li>
                                    <li>安装完成后，重启 IntelliJ IDEA</li>
                                </ul>
                            </div>
                        </div>
                        
                        <div class="flex items-start">
                            <div class="flex-shrink-0 bg-indigo-100 rounded-full p-2 mr-4">
                                <span class="text-indigo-600 font-bold">3</span>
                            </div>
                            <div>
                                <h4 class="font-bold text-gray-800 mb-2">登录 GitHub 账号</h4>
                                <ul class="list-disc pl-5 text-gray-600 space-y-1">
                                    <li>打开 IntelliJ IDEA，进入 Settings → Tools → GitHub Copilot</li>
                                    <li>点击 Log in to GitHub</li>
                                    <li>在弹出的 GitHub 认证窗口中授权</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div>
                    <img src="https://cdn.nlark.com/yuque/0/2025/png/21449790/1743597443039-e3d0b1aa-49cd-4982-bad0-67eec9584a78.png" alt="GitHub Copilot 安装界面" class="rounded-lg shadow-lg">
                </div>
            </div>
            
            <div class="bg-white rounded-xl shadow-lg overflow-hidden">
                <div class="p-6 md:p-8">
                    <h3 class="text-2xl font-bold mb-6 text-gray-800">常见问题解答</h3>
                    
                    <div class="space-y-6">
                        <div>
                            <h4 class="font-bold text-lg text-gray-800 mb-2">如何提高 Copilot 代码建议的质量？</h4>
                            <p class="text-gray-600">多写注释，详细描述需求，Copilot 会提供更精准的代码。使用清晰的函数命名，如 <code class="bg-gray-100 px-1 py-0.5 rounded">calculateTotalPrice()</code> 而不是 <code class="bg-gray-100 px-1 py-0.5 rounded">func1()</code>。查看多个 AI 建议，按 <code class="bg-gray-100 px-1 py-0.5 rounded">Ctrl + Enter</code> 查看不同代码版本。</p>
                        </div>
                        
                        <div>
                            <h4 class="font-bold text-lg text-gray-800 mb-2">Copilot 在 IntelliJ IDEA 不工作怎么办？</h4>
                            <p class="text-gray-600">检查是否登录 GitHub 账户（Settings → Tools → GitHub Copilot）。插件是否正确安装（Settings → Plugins 中查看）。尝试重启 IntelliJ IDEA。检查订阅状态（访问 Copilot 官网）。</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Use Cases -->
    <section class="py-16 px-4 bg-indigo-50">
        <div class="container mx-auto max-w-6xl">
            <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">适用场景</h2>
            
            <div class="grid md:grid-cols-3 gap-8">
                <div class="bg-white p-6 rounded-xl shadow-md card-hover transition duration-300">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 p-3 rounded-lg mr-4">
                            <i class="fas fa-coffee text-indigo-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">Java 开发者</h3>
                    </div>
                    <p class="text-gray-600">Copilot 帮助快速编写 Spring Boot 代码，自动补全常用框架方法，提高开发效率。</p>
                </div>
                
                <div class="bg-white p-6 rounded-xl shadow-md card-hover transition duration-300">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 p-3 rounded-lg mr-4">
                            <i class="fab fa-react text-indigo-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">前端开发者</h3>
                    </div>
                    <p class="text-gray-600">Copilot 可以自动补全 React/Vue 组件，生成常用 UI 代码片段，减少重复劳动。</p>
                </div>
                
                <div class="bg-white p-6 rounded-xl shadow-md card-hover transition duration-300">
                    <div class="flex items-center mb-4">
                        <div class="bg-indigo-100 p-3 rounded-lg mr-4">
                            <i class="fas fa-graduation-cap text-indigo-600 text-xl"></i>
                        </div>
                        <h3 class="text-xl font-bold text-gray-800">初学者</h3>
                    </div>
                    <p class="text-gray-600">Copilot 作为代码老师，帮助学习新语言，提供代码示例和最佳实践。</p>
                </div>
            </div>
        </div>
    </section>

    <!-- Visualization -->
    <section class="py-16 px-4">
        <div class="container mx-auto max-w-6xl">
            <h2 class="text-3xl font-bold text-center mb-12 text-gray-800">GitHub Copilot 工作流程</h2>
            
            <div class="bg-white p-6 rounded-xl shadow-lg">
                <div class="mermaid">
                    graph TD
                    A[开发者输入代码或注释] --> B[Copilot 分析上下文]
                    B --> C[生成代码建议]
                    C --> D{开发者选择}
                    D -->|接受| E[代码插入编辑器]
                    D -->|拒绝| F[提供更多建议]
                    F --> C
                    E --> G[继续开发]
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-8 px-4">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold">技术小馆</h3>
                    <p class="text-gray-400">探索技术前沿，分享开发经验</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-300 hover:text-white transition duration-300">
                        <i class="fas fa-globe mr-2"></i>http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-400">
                <p>© 2023 技术小馆. 保留所有权利.</p>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>